<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/24 0024
 * Time: 20:48
 */
namespace app\admin\controller;
use think\Controller;
use think\Request;

class Image extends Controller {
    public function ajaxuploadimage (){
        $file = Request::instance()->file('file');
        // 给定一个目录
        $info = $file->move('upload');
        if($info && $info->getPathname()) {
            return show(1, 'success', '/'.$info->getPathname());
        }
        return show(0, 'upload error');
    }

    public function kindupload (){
        $file = Request::instance()->file('imgFile');
        // 给定一个目录
        $info = $file->move('kindupload');
        if($info && $info->getPathname()) {
            return showKind(0, '/'.$info->getPathname());
        }
        return showKind(1, '上传失败');
    }
}